-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make caps.Capability
non-experimental
#23507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We also need to make SharedCapability (and maybe Control) non-experimental, since Label will extend it. |
01849f0
to
72ced26
Compare
72ced26
to
be436ce
Compare
be436ce
to
a402cf3
Compare
library/src/scala/caps/package.scala
Outdated
@@ -24,14 +24,12 @@ import annotation.{experimental, compileTimeOnly, retainsCap} | |||
* | |||
* Capability has exactly two subtraits: Shared and Exclusive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's at least make the scaladocs with @experimental or mention it, so that people are aware that there is still a scenario that this might be deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgodzik I think we are ready to commit to that now. That is, if capture checking becomes standard at one time then we plan to have these traits defined. The doc page is waiting to be merged here: https://github.com/scala/scala3/blob/3658d3da98eb0c5ed33c74ec6402562330bf9ed8/docs/_docs/reference/experimental/capture-checking/classifiers.md
If capture checking does not make it into the standard, the whole caps
package would be deprecated and dropped. So in a sense it does not matter which traits are exposed in there.
An alternative would be to bend the rules so that we make boundary.Label
non-experimental even though it would extend experimental traits, which is usually not allowed. I am not sure that would address the concerns with inlining though. @natsukagami can you comment on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine I think. I was mostly hoping to mention in some place that this is not something people should use unless they are experimenting with CC
These are all neccessary for boundary.Label
a402cf3
to
0ad0244
Compare
@tgodzik Good point. We should mention that these traits make sense only for capture checking, which is experimental. |
@natsukagami Let's add a note to this effect in the doc comments of all affected traits. |
I updated the doc-comments to mention experimental capture checking on all traits |
Closes #22745.
Make
scala.caps.Capability
non-experimental.The
Capability
trait can be used as a marker trait even outside of capture-checking.Only when capture checking is enabled, the trait carries a special meaning, marking each instance a top-level capability.
Other definitions inside the
scala.caps
package (the package is already non-experimental) stays experimentaland can only be used with
-experimental
or with capture-checking enabled (with an import or with the feature flag).